package com.myproject.myblogserver.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.myproject.myblogserver.entity.VerificationCode;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface VerificationCodeMapper extends BaseMapper<VerificationCode> {
    // 根据邮箱更新删除标记，默认删除标记为 1
    @Update("UPDATE verification_code SET is_deleted = 1 WHERE email = #{email}")
    int updateIsDeletedByEmail(String email);

    // 根据邮箱和指定的删除标记更新
    // @Update("UPDATE verification_code SET is_deleted = #{isDeleted} WHERE email = #{email}")
    // int updateIsDeletedByEmail(String email, Byte isDeleted);
}
